package com.jwds.digital.bios.business.api.controller.flow;

import com.jwds.digital.bios.business.core.infrastructure.dto.flow.FlowBasicReqDTO;

import com.jwds.digital.bios.business.core.infrastructure.vo.feign.FlowBasicRespVO;
import com.jwds.digital.bios.business.service.service.flow.IFlowBasicService;
import com.jwds.tdc.framework.application.lib.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Description FlowBasicController
 * @Author xiao  xun
 * @Date 2024-12-12
 */
@Slf4j
@Api(tags = "流程基础信息表")
@RestController
@RequestMapping("/flow/basic")
public class FlowBasicController {
    @Resource
    private IFlowBasicService service;

    @PostMapping("/all")
    @ApiOperation(value = "列表查询")
    public BaseResponse<List<FlowBasicRespVO>> list(@Valid @RequestBody FlowBasicReqDTO reqDto) {
        List<FlowBasicRespVO> respVoList = service.list(reqDto);
        return BaseResponse.success(respVoList);
    }

    @ApiOperation(value = "路线详细查询")
    @GetMapping("/info/{id}")
    public BaseResponse<Map<String, Map<String, BigDecimal>>> getBeltInfo(@PathVariable Long id) {
        Map<String, Map<String, BigDecimal>> map = service.getBeltInfoById(id);
        return BaseResponse.success(map);
    }

}
